package com.life.wd.mapper;

import com.github.pagehelper.Page;
import com.life.wd.dto.ProductQueryRequest;
import com.life.wd.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ProductMapper {
    /**
     * 插入产品
     * @param product 产品实体
     */
    void insert(Product product);

    Product selectById(Long id);

    Page<Product> listProducts(ProductQueryRequest queryRequest);

    Product getById(Long id);

    int update(Product product);

    /**
     * 根据ID删除产品
     */
    int delete(@Param("id") Long id);
}
